﻿using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TestTCPServer
{
    class RequestHandler1 : CPPEI.Net.TCP.BaseRequest<TestTCPContract.DrawReq>
    {
        protected override void OnHandle(CPPEI.Net.NetClientProxy client, CPPEI.Net.Package package, TestTCPContract.DrawReq data)
        {
            Console.WriteLine(data.Message);
            Console.WriteLine(data.Value);

            TestTCPContract.DrawResp model = new TestTCPContract.DrawResp();
            model.Message2 = "我是消息长度最大128";
            model.Message = "我是消息长度最大32";
            model.Value = DateTime.Now.Second;
            client.Send(new CPPEI.Net.Package(TestTCPContract.Scenario.Scene1,
                TestTCPContract.Command.Scene1.Cmd1,
                CPPEI.Net.BufferUtil.ToData(model)));
        }
    }
}
